package com.it.plic;

import java.io.IOException;
import java.net.*;

/**
 * @author げっしょく
 * @date 2021/8/8
 */
public class Demo3_1 {
    public static void main(String[] args) throws IOException{
        MulticastSocket ms = new MulticastSocket(10000);
        ms.joinGroup(InetAddress.getByName("224.0.1.0"));
        DatagramPacket dp = new DatagramPacket(new byte[1024], 024);
        ms.receive(dp);
        byte[] data = dp.getData();
        int length = dp.getLength();
        System.out.println(new String(data, 0, length));

    }
}
